<?php

/**
 * O2O团购PC版本
 * ============================================================================
 * * 版权所有 2009-2016 郑州司科计算机科技有限公司，并保留所有权利。
 * 购买网址: http://www.jzphp.com；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
  * 咨询电话：400-823-0371 QQ：313999875
 * ============================================================================
 * $Author: zzsike $
 * $Time 2016-02-03 sammy $
*/


require_once(dirname(dirname(__FILE__)) . '/appwap.php');

$id = abs(intval($_GET['id']));
if (!$id || !$team = Table::FetchForce('team', $id) ) {
	redirect('index.php');
}

$discount_price = $team['market_price'] - $team['team_price'];

$partner = Table::Fetch('partner', $team['partner_id']); //�����̼���Ϣ

$team['partner_title'] = $partner['title'];
$team['partner_phone'] = $partner['phone'];
$team['partner_address'] = $partner['address'];
$team['longlat'] = $partner['longlat'];
if ($team['longlat']) list($longi,$lati) = preg_split('/[,\s]+/',$team['longlat'],-1,PREG_SPLIT_NO_EMPTY);


$left = array();
$now = time();
$diff_time = $left_time = $team['end_time']-$now;

$left_day = floor($diff_time/86400);
$left_time = $left_time % 86400;
$left_hour = floor($left_time/3600);
$left_time = $left_time % 3600;
$left_minute = floor($left_time/60);
$left_time = $left_time % 60;

team_state($team);
include template('wap_detail');
